import request from '@/utils/http.js';

export const queryAdoptionByPageAPI = ({page=1, pageSize=10, userId, status, gender, name}) => {
    return request({
        url: '/adopt/page',
        method: 'GET', 
        params: {
            page,
            pageSize,
            userId,
            status,
            gender,
            name,
        }
    })
}

export const addAdoptionApplyAPI = (params) => {
    return request({
        url: '/adopt/add',
        method: 'POST',
        data: params
    })
}

export const getAdoptionDetailAPI = (adoptId) => {
    return request({
        url: `/adopt/getAdoptionDetail/${adoptId}`,
        method: 'GET'
    })
}

export const editAdoptionApplyAPI = (params) => {
    return request({
        url: '/adopt/edit',
        method: 'POST',
        data: params
    })
}

export const deleteAdoptionApplyAPI = (adoptId) => {
    return request({
        url: `/adopt/delete/${adoptId}`,
        method: 'POST'
    })
}

export const GetApplyIdByPetId = (petId) => {
    return request({
        url: `/adopt/getApplyIdByPetId/${petId}`,
        method: 'GET'
    })
}

export const isAdopting = ({userId, petId}) => {
    return request({
        url: `/adopt/isAdopting/${userId}/${petId}`,
        method: 'GET'
    })
}